# 导包
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
# 获取浏览器对象
driver = webdriver.Firefox()
# 打开测试的网址
driver.get('file:///D:/nsd2404/html/registerA.html')
# 定位用户名输入框
username = driver.find_element(By.CSS_SELECTOR, '#userA')
username.send_keys('admin')
sleep(3)
# 输入新的内容之前，需要把之前的内容清空
username.clear()
username.send_keys('hello')

# 定位香蕉单选框
sleep(3)
banner = driver.find_element(By.ID, 'xja')
banner.click()

# 停顿3秒，点击提交按钮
sleep(3)
driver.find_element(By.CSS_SELECTOR, 'button').click()

# 停顿3秒，关闭浏览器
sleep(3)
driver.quit()